/******************************************************************************
* This file is part of is32p218 platform,
* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
* This software may only be used under the terms of a valid, current,
* end user license from InfoStrong.
* Nothing else gives you the right to use this software.   
*
* Name:   drv_tmr.h
* Desc:   
* Author: Jerry
* Date:   2009-9-16
* Note:   
* History:
*
******************************************************************************/
#include "def.h"
#include "option.h"

#ifndef __DRV_TMR_H__
#define __DRV_TMR_H__

#define TMR_UTCLK_REQ	EXTCLK_FREQ

#define TMR0_OS		0	/* For OS tick */
#define TMR1_DELAY	1	/* Not used */
#define TMR2_PLC_IF	2	/* For PLC if */
#define TMR3_NUM	3	/* Not used */
#define TMR4_UART2	4	/* For UART Simulator */
#define TMR5_NUM	5	/* Not used, Xn5106C will be used to PWM */
#define TMR_NO_MAX	(TMR5_NUM)

#define TMR_ADDR_GAP	0x10

BOOL drv_tmr_set( S32 tmr_num, U32 interval );
void drv_tmr_ena( S32 tmr_num, BOOL flg );
BOOL drv_tmr_ena_check( S32 tmr_num, BOOL flg );
BOOL drv_tmr_tmout( S32 tmr_num );
void drv_tmr_init( void );
BOOL drv_tmr_check( S32 tmr_num, U32 interval );
BOOL drv_tmr_status_check( void );
void drv_tmr_status_set( void );



#endif /*__DRV_TMR_H__*/
